/*
 * @Date: 2023-03-18 11:09:41
 * @LastEditors: Zireael 1193875164@qq.com
 * @LastEditTime: 2023-03-18 11:13:26
 * @FilePath: \A19\backend\src\api\talks\ApiDeleteFollowTalk.ts
 */
import { ApiCall } from "tsrpc";
import { ReqDeleteFollowTalk, ResDeleteFollowTalk } from "../../shared/protocols/talks/PtlDeleteFollowTalk";
import { Global } from '../../Global/index';

export default async function (call: ApiCall<ReqDeleteFollowTalk, ResDeleteFollowTalk>) {
    // TODO
    const { talkId,followTalkId } = call.req

    await Global.collection('talks').updateOne({
        _id:talkId
    },{
        $pull:{
            follows:{
                _id:followTalkId
            }
        }
    })

    call.succ({
        
    })
}